package cn.kn.triage.sys.service.impl;

import cn.kn.triage.common.model.R;
import cn.kn.triage.common.servic.BaseService;
import cn.kn.triage.sys.mapper.VUserRoleMapper;
import cn.kn.triage.sys.model.VUserRoleExample;
import cn.kn.triage.sys.service.VUserRoleService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

/**
 * @author yinzn
 * @create 2020-10-15 17:45
 */
@Service
public class VUserRoleServiceImpl extends BaseService implements VUserRoleService {
    private final VUserRoleMapper vUserRoleMapper;

    public VUserRoleServiceImpl(VUserRoleMapper vUserRoleMapper) {
        this.vUserRoleMapper = vUserRoleMapper;
    }

    @Override
    public R findAll() {
        VUserRoleExample vUserRoleExample = new VUserRoleExample();
        vUserRoleExample.createCriteria()
                .andCnameLike("%小%")
                .andRnameLike("%医%");
        PageInfo pageInfo =new PageInfo(vUserRoleMapper.selectByExample(vUserRoleExample));
        return R.ok(pageInfo);
    }
}
